package org.rcgwt.sample.client.model;

import java.util.ArrayList;
import java.util.List;

import org.rcgwt.client.model.IsReflected;

import com.google.gwt.user.client.Random;
import com.google.gwt.user.client.rpc.IsSerializable;

/**
 * Employee.
 * 
 * @author Didier MOISE
 */
@IsReflected
public class Employee implements IsSerializable {

    public static List<Employee> getEmployees(int nbemployees) {
        List<Employee> employees = new ArrayList<Employee>();

        int id = 0;
        employees.add(new Employee(id++, "John", "SMITH", "ActionDialog.class"));
        employees.add(new Employee(id++, "Mario", "JAMES", "mjames@hello.com"));
        employees.add(new Employee(id++, "Tom", "LAGRANGE",
                "tlagrange@hello.com"));
        employees.add(new Employee(id++, "Henry", "FORD", "hford@hello.com"));

        for (int i = 0; i < nbemployees; i++) {
            employees.add(new Employee(id++, Random.nextInt() + "FN", Random
                    .nextInt()
                    + "LN", Random.nextInt() + "email@hello.com"));
        }

        return employees;
    }

    private Long id;

    private String lastName;

    private String firstName;

    private String email;

    public Employee() {
    }

    public Employee(long id, String firstName, String lastName, String email) {
        this.id = id;
        this.firstName = firstName;
        this.lastName = lastName;
        this.email = email;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
